import { _decorator, Component, JsonAsset } from 'cc';
import { HallResConstant } from "../Data/ChengYu_GameData";
import { bdlMgr } from "../../../../../../../Script/Manager/BundleManager_S";

export class ChengYu_ConfigManager extends Component {

    // static async getChengYuLevelDataCfg() {
    //     let cfg = await bdlMgr.getRes<JsonAsset>(`hall`, HallResConstant.CONFIG_PATH.level, JsonAsset)
    //     return cfg.json;

    //     //     let cfg = <{ [key: string]: any }>this.cfgPath2ObjMap.get(HallResConstant.CONFIG_PATH.level);
    //     //     return cfg;
    // }

    //    // 获取关卡成语游戏数据
    static async getChengYuPic_LevelDataCfg() {
        let cfg = await bdlMgr.getRes<JsonAsset>(`hall`, HallResConstant.CONFIG_PATH.pic_level, JsonAsset)
        return cfg.json;
        // let cfg = <{ [key: string]: any }>this.cfgPath2ObjMap.get(HallResConstant.CONFIG_PATH.pic_level);
        // return cfg;
    }
    //    // 获取第1个成语游戏数据
    static async getChengYuGameDataCfg_1() {
        let cfg = await bdlMgr.getRes<JsonAsset>(`hall`, `config/json/chengyu/main_questions`, JsonAsset)
        return cfg.json;

        // let cfg = <{ [key: string]: any }>this.cfgPath2ObjMap.get(HallResConstant.CONFIG_PATH.main_questions);
        // return cfg;
    }
    //    // 获取第2个成语游戏数据
    static async getChengYuGameDataCfg_2() {
        let cfg = await bdlMgr.getRes<JsonAsset>(`hall`, HallResConstant.CONFIG_PATH.judge_questions, JsonAsset)
        return cfg.json;

        // let cfg = <{ [key: string]: any }>this.cfgPath2ObjMap.get(HallResConstant.CONFIG_PATH.judge_questions);
        // return cfg;
    }
    //    // 获取第3个成语游戏数据
    static async getChengYuGameDataCfg_3() {
        let cfg = await bdlMgr.getRes<JsonAsset>(`hall`, HallResConstant.CONFIG_PATH.pic_questions, JsonAsset)
        return cfg.json;
        // let cfg = <{ [key: string]: any }>this.cfgPath2ObjMap.get(HallResConstant.CONFIG_PATH.pic_questions);
        // return cfg;
    }
    //    // 成语解释
    static async getChengYuGameDataCfg_idiom_info() {
        let cfg = await bdlMgr.getRes<JsonAsset>(`hall`, HallResConstant.CONFIG_PATH.idiom_info, JsonAsset)
        return cfg.json;
        // let cfg = <{ [key: string]: any }>this.cfgPath2ObjMap.get(HallResConstant.CONFIG_PATH.idiom_info);
        // return cfg;
    }
}

window["ChengYu_ConfigManager"] = ChengYu_ConfigManager;